<template>
    <div class="confirmOrder">
      <!--按照课程名称来显示订单信息？？？
      <br>
      按照老师的个人信息查询课程表>再从课程表看订单？？？-->
      <mt-header title="教材订购的核实">
        <router-link to="InfoList" slot="left">
          <mt-button icon="back">返回</mt-button>
        </router-link>
        <mt-button icon="more" slot="right"></mt-button>
      </mt-header>

      <mt-navbar v-model="selected">
        <mt-tab-item v-bind:id="item.courseId" v-for="item in course" >{{ item.courseName }}</mt-tab-item>
      </mt-navbar>

      <!-- tab-container -->
      <mt-tab-container v-model="selected">
        <mt-tab-container-item  v-for=" (item , itemIndex) in course" v-bind:id="item.courseId">
          <!--<mt-cell
            title="教材的名字"
            to="OrderDetails"
            is-link
            value="">
          </mt-cell>-->
          <mt-cell
            v-for="(order , index) in item.order"
            :title="order.orderId"
            :label="order.label"
            is-link
            @click.native.prevent="checkDetails(itemIndex,index,course)"/>
        </mt-tab-container-item>
      </mt-tab-container>
    </div>
</template>
<style>
</style>
<script>
    export default{
        name : 'confirmOrder',
        data(){
            return{
                //
                selected:'',
                //
                course:[
                    {
                        courseId: '1002',
                        courseName: '计算机系统',
                        order:[
                            {
                                orderId:'orderId01',
                                label:'label'
                            },
                            {
                                orderId:'orderId02',
                                label:'label'
                            }
                        ]
                    },
                    {
                        courseId: '1003',
                        courseName: 'PD',
                        order:[
                            {
                                orderId:'orderId001',
                                label:'label'
                            }
                        ]
                    }
                ]
            }
        },
        components:{
        },
        mounted:function(){
            this.$nextTick(function(){
                //this.initList();
            })
        },
        methods:{
            //init list

            //check the course details
            checkDetails:function(firstIndex,index,rows){
                //console.log(rows[index].orderId);
                this.$router.push({ name: 'OrderDetails', params: { orderId: rows[firstIndex].order[index].orderId }})
            }

        }
    }
</script>
